package com.ruoyi.purchase.mapper;

import java.util.List;
import com.ruoyi.purchase.domain.MaterialReceive;
import com.ruoyi.purchase.domain.MaterialReceiveDetail;
import com.ruoyi.purchase.vo.BoxCodesVO;
import com.ruoyi.purchase.vo.MaterialReceiveVO;
import org.apache.ibatis.annotations.Param;

/**
 * 收料通知单Mapper接口
 * 
 * @author ruoyi
 * @date 2025-10-29
 */
public interface MaterialReceiveMapper
{
    List<BoxCodesVO> selectBoxCodesByReceiveId(String receiveId);

    int updateIsRejected(Long id, Long isRejected);

    String selectMaxReceiveId(String datePrefix);



    MaterialReceiveVO selectMaterialReceiveByDeliveryId(String deliveryId);



    MaterialReceiveVO selectMaterialReceiveByBoxCode(String boxCode);

    MaterialReceiveVO selectMaterialReceiveByreceiveId(String deliveryId);


    /**
     * 查询收料通知单列表
     *
     * @param materialReceive 收料通知单
     * @return 收料通知单集合
     */

    List<MaterialReceiveVO> selectMaterialReceiveVOList(MaterialReceive materialReceive);



    /**
     * 查询收料通知单页面列表VO
     *
     * @param id 收料通知单主键
     * @return 收料通知单
     */
    MaterialReceiveVO selectMaterialReceiveVOById(Long id);




    int updateReceivingStatusByBatch(@Param("batch") String batch, @Param("recevingStatus") Long recevingStatus);



    /**
     * 查询收料通知单
     * 
     * @param id 收料通知单主键
     * @return 收料通知单
     */
    public MaterialReceive selectMaterialReceiveById(Long id);

    /**
     * 查询收料通知单列表
     * 
     * @param materialReceive 收料通知单
     * @return 收料通知单集合
     */
    public List<MaterialReceive> selectMaterialReceiveList(MaterialReceive materialReceive);

    /**
     * 根据收料通知单的id查询收料通知单详情列表
     *
     * @param materialReceive 收料通知单
     * @return 收料通知单集合
     */
    public List<MaterialReceiveDetail> selectMaterialReceiveDetailList(String receiveId);

    /**
     * 新增收料通知单
     * 
     * @param materialReceive 收料通知单
     * @return 结果
     */
    public int insertMaterialReceive(MaterialReceive materialReceive);

    /**
     * 修改收料通知单
     * 
     * @param materialReceive 收料通知单
     * @return 结果
     */
    public int updateMaterialReceive(MaterialReceive materialReceive);

    /**
     * 删除收料通知单
     * 
     * @param id 收料通知单主键
     * @return 结果
     */
    public int deleteMaterialReceiveById(Long id);

    /**
     * 批量删除收料通知单
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteMaterialReceiveByIds(Long[] ids);

    /**
     * 批量删除${subTable.functionName}
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteMaterialReceiveDetailByReceiveIds(Long[] ids);
    
    /**
     * 批量新增${subTable.functionName}
     * 
     * @param materialReceiveDetailList ${subTable.functionName}列表
     * @return 结果
     */
    public int batchMaterialReceiveDetail(List<MaterialReceiveDetail> materialReceiveDetailList);
    

    /**
     * 通过收料通知单主键删除${subTable.functionName}信息
     * 
     * @param id 收料通知单ID
     * @return 结果
     */
    public int deleteMaterialReceiveDetailByReceiveId(Long id);
}
